#ifndef BEANEATER_H
#define BEANEATER_H

#include <QMainWindow>
#include<qpainter.h>
#include<qstring.h>
#include<QVector>

namespace Ui {
class beaneater;
}

class beaneater : public QMainWindow
{
    Q_OBJECT

public:
    explicit beaneater(QWidget *parent = 0);
    ~beaneater();
    void paintEvent(QPaintEvent *event);
    void Initbeaneater();
    QRect CreateRect();
    void IsEat();
private slots:
    void beaneater_update();
    void deathTimeout();
private:
    Ui::beaneater *ui;
    QRect vbeaneaterRect;
    void keyPressEvent(QKeyEvent *key);
    QTimer *timer;
    QTimer* deathTimer;
    int deathCountdown = 60;
    bool blsRun;
    bool blsOver;
    QString sDisplay;
    int nDirection;
    int speed;
    QRect food;
    int nScore;
    QString scoreLabel;
    QString timerLabel;
    int frame = 0;
};

#endif // BEANEATER_H